/*
 * @Description:
 * @Author: wangfuwei
 * @Date: 2020-11-30 13:18:33
 * @LastEditors: wangfuwei
 * @LastEditTime: 2021-04-26 13:48:04
 * @FilePath: /horizon-frontend/vue.config.js
 */
const path = require("path");
const resolve = dir => path.join(__dirname, dir);
const createThemeColorReplacerPlugin = require("./config/plugin.config");

module.exports = {
  chainWebpack: config => {
    // 添加别名
    config.resolve.alias.set("@$", resolve("src"));
  },

  css: {
    loaderOptions: {
      less: {
        //less支持
        javascriptEnabled: true,
      },
    },
  },

  configureWebpack: {
    plugins: [createThemeColorReplacerPlugin()], //动态切换主题
    devtool: "source-map",
  },

  devServer: {
    port: 8081,
  },
};
